package com.hbx.platform.org.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hbx.platform.base.domain.BaseDomain;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author: hbx
 * @date: 2024/03/29
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ExcelTarget("Department")
public class Department extends BaseDomain implements Serializable { //id 被抽取
    @ApiModelProperty("部门名称")
    @Excel(name = "部门名称",orderNum = "7")
    private String name;
    @ApiModelProperty("部门简介")
    private String intro;
    @ApiModelProperty("部门状态")
    private Boolean state;
    private String path;
    @ApiModelProperty("上级部门id，自连接")
    private Long parentId;
    @ApiModelProperty("部门管理者的id,对应员工表")
    private Long managerId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("用于前端分页显示管理者的名称")
    private Employee manager;
    @ApiModelProperty("用于前端分页显示上级部门名称")
    private Department parent;
    @ApiModelProperty("用于前端的级联选择器")
    private List<Department> children = new ArrayList<>();
}
